package com.huaxindata.im.model.utils;

import com.huaxindata.im.R;

/**
 * Created by Administrator on 2017/8/15.
 */

public class RandomIconDrawable {
    public final static int[] COLORS = {
            R.drawable.contact_circle1,
            R.drawable.contact_circle2,
            R.drawable.contact_circle3,
            R.drawable.contact_circle4,
            R.drawable.contact_circle5,
            R.drawable.contact_circle6,
            R.drawable.contact_circle7,
            R.drawable.contact_circle8
    };
    //没有头像时，显示的背景色；l可能不用的人需要显示不同的颜色
    public static int getNameDrawable(String name) {
        return COLORS[Math.abs(name.hashCode() % COLORS.length)];
    }
}
